home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
MPNeuGadgets2.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-09-17
|
38KB
|
776 lines
/*
STRPTR G_PList, G_Select_Name, G_New, G_Remove, G_Entries, G_UK_New_Entry, G_UK_Entry_Type, G_Promotion, G_Select_Screen_Mode,
G_Overscan, G_Width, G_Height, G_Colors, G_Palette, G_Color_Slider, G_Edit_Palette, G_Autoscroll, G_Interleave, G_Behind,
G_Blank_Border, G_Force_Planar, G_Center, G_3D_Look, G_3D_Default, G_3D_Reset, G_Font, G_Font_Select, G_Font_Fix_Aspect,
G_Share_Pens, G_SP_Exclude, G_Make_Public, G_Pub_Name, G_Do_Hotkey, G_Hotkey, G_Save, G_Use, G_Cancel, G_UK_Use_Delete,
G_UK_Never_Again, G_UK_Cancel;
#include "mpp.h"
#include <extras/macros/intuition.h>
#include <extras/layoutgt.h>
#include <clib/extras_protos.h>
#include <libraries/gadtools.h>
#include <intuition/gadgetclass.h>
struct LG_Control *GadControl,*PGad2GadControl;
extern float XScale,YScale;
struct Hook StrHook,PenLVHook,StrCursorHook,PromotionLVHook;
extern UBYTE *CenterLabels[],*SFontLabels[],*OverscanLabels[],*ModeSelLabels[],*ListLabels[];
extern struct TextFont *GUIFont;
extern struct TextArea ColorDisp, PenNameDisp, FontDisp;
extern struct Window *Win;
extern struct MPMessage *ForcedEditMsg;
WORD WindowWidth=630,WindowHeight=256;
struct IBox GadgetArea[TOTAL_AREAS];
struct List OptionList;
struct LG_Control *MakeMPPGadgets(struct Window *Window, APTR VisualInfo, struct TextAttr *TA)
{
// WORD MaxPGadWidth;
LONG l,ww,wh,feditspace;
float xs;
// char colorkeys[5],*colorstr;
/*
struct IBox ibox[]={
{5, 4, 196, 192}, // list
{209, 4, 234, 91}, // promm
{209, 101, 234, 38}, // opt
{453, 4, 171, 98}, // td
{209, 145, 234, 51}, // font
{453, 108, 171, 26}, // shrp
{453, 140, 171, 25}, // pub
{453, 171, 171, 25}, // hotk
{5, 202, 619, 12} // pgad
};
*/
struct IBox ibox[]={
{7, 4, 194, -25}, // list
{212, 4, 232, 91}, // promm
{212, 101, 232, -179}, // opt
{455, 4, 169, -119}, // td
{212, -72, 232, 51}, // font
{455, -109, 169, 26}, // shrp
{455, -77, 169, 25}, // pub
{455, -46, 169, 25}, // hotk
{7, -15, 617, 12} // pgad
};
ww=((float)GetWinInnerWidth(Window)/XScale);
wh=((float)GetWinInnerHeight(Window)/YScale);
xs=(float)ww/(float)WindowWidth;
/*
colorstr=GetString(MSG_G_COLOR_SLIDER);
colorkeys[0]=KeyUnshifted(colorstr[1]);
colorkeys[1]=KeyUnshifted(colorstr[0]);
colorkeys[2]=KeyShifted(colorstr[1]);
colorkeys[3]=KeyShifted(colorstr[0]);
colorkeys[4]=0;
printf("%s - %s\n",colorstr,colorkeys);
*/
for(l=0;l<TOTAL_AREAS;l++)
{
GadgetArea[l].Left =ibox[l].Left *xs;
GadgetArea[l].Width =ibox[l].Width *=xs;
GadgetArea[l].Top= (ibox[l].Top<0 ? ibox[l].Top +=wh : ibox[l].Top);
GadgetArea[l].Height= (ibox[l].Height<0 ? ibox[l].Height+=wh : ibox[l].Height);
}
feditspace=(GadgetArea[PGAD_AREA].Width-128)/3;
GadControl=LG_CreateGadgets( /* init shit */
LG_VisualInfo ,VisualInfo,
LG_UseWindowOffsets ,Window,
LG_EraseRemoved ,FALSE,
LG_TextAttr ,TA,
LG_ScaleX ,(ULONG)(XScale * 65535),
LG_ScaleY ,(ULONG)(YScale * 65535),
/* List gadget offsets */
LG_Bounds ,&GadgetArea[LIST_AREA],
LG_SkipGadgets ,(ForcedEditMsg ? 7 : 0),
/* List type */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_PLIST),
LG_GadgetID ,GD_TYPE,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&ListLabels[0],
LG_CreateGadget ,0,
/* SELECT_NAME */
LG_TopEdge ,LG_REL_BOTTOM(-12),
LG_GadgetText ,GetString(MSG_G_SELECT_NAME),
LG_GadgetID ,GD_SELECT_NAME,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* New */
LG_HorizCells ,2,
LG_RelHorizGap ,2,
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(0),
LG_TopEdge ,LG_REL_BOTTOM(-25),
LG_Width ,LG_REL_CELL_WIDTH(1),
LG_GadgetText ,GetString(MSG_G_NEW),
LG_GadgetID ,GD_NEW,
LG_CreateGadget ,0,
/* Remove */
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(1),
LG_GadgetText ,GetString(MSG_G_REMOVE),
LG_GadgetID ,GD_REMOVE,
LG_CreateGadget ,0,
/* Entry Name */
LG_LeftEdge ,0,
LG_TopEdge ,LG_REL_BOTTOM(-38),
LG_Width ,LG_REL_WIDTH(-18),
LG_GadgetText ,0,
LG_GadgetID ,GD_NAME,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,2,
GTIN_EditHook ,&StrCursorHook,
GTST_MaxChars ,256,
LG_CreateGadget , 0,
/* List */
LG_TopEdge ,29,
LG_Height ,LG_REL_HEIGHT(-55),
LG_GadgetText ,GetString(MSG_G_ENTRIES),
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetID ,GD_LIST,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,5,
GT_Underscore ,'_',
GTLV_ShowSelected ,GD_NAME,
GTLV_ScrollWidth ,(ULONG)(18 * XScale),
GTLV_CallBack ,&PromotionLVHook,
LAYOUTA_Spacing ,1,
LG_CreateGadget ,0,
/* Move */
LG_LeftEdge ,LG_REL_RIGHT(-18),
LG_Width ,18,
LG_GadgetID ,GD_MOVE,
LG_GadgetKind ,SLIDER_KIND,
LG_GadgetText ,0,
LG_GadgetTags ,5,
GT_Underscore ,'_',
PGA_Freedom ,LORIENT_VERT,
GTSL_Min ,0,
GTSL_Max ,0,
GTSL_Level ,0,
LG_CreateGadget ,0,
/* End of list gadgets */
LG_SkipGadgets ,(ForcedEditMsg ? 0 : 2),
LG_LeftEdge ,0,
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_UK_NEW_ENTRY),
LG_GadgetID ,GD_FE_ENTRY_NAME,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,3,
GTTX_Border ,1,
GTTX_Justification ,GTJ_CENTER,
GTTX_Clipped ,1,
LG_CreateGadget ,0,
LG_TopEdge ,39,
LG_GadgetText ,GetString(MSG_G_UK_ENTRY_TYPE),
LG_GadgetID ,GD_FE_ENTRY_TYPE,
LG_CreateGadget ,0,
/* Promotion Gads */
LG_Bounds ,&GadgetArea[PROM_AREA],
/* ModeSel */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_PROMOTION),
LG_GadgetID ,GD_MODESEL,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore,'_',
GTCY_Labels, &ModeSelLabels[0],
LG_CreateGadget ,0,
/* SelMode */
LG_TopEdge ,13,
LG_GadgetText ,GetString(MSG_G_SELECT_SCREEN_MODE),
LG_GadgetID ,GD_SELMODE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* Screen Mode */
LG_TopEdge ,26,
LG_GadgetText ,0,
LG_GadgetID ,GD_SCREENMODE,
LG_GadgetKind ,TEXT_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTTX_Border, TRUE,
LG_CreateGadget ,0,
/* Overscan */
LG_TopEdge ,39,
LG_GadgetText ,GetString(MSG_G_OVERSCAN),
LG_GadgetID ,GD_OVERSCAN,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels, &OverscanLabels[0],
LG_CreateGadget ,0,
LG_HorizCells ,2,
LG_RelHorizGap ,8,
/* Width */
LG_TopEdge ,52,
LG_Width ,LG_REL_CELL_WIDTH(1),
// LG_Width ,GadgetArea[PROM_AREA].Width/2-8,
LG_GadgetText ,GetString(MSG_G_WIDTH),
LG_GadgetID ,GD_WIDTH,
LG_GadgetKind ,INTEGER_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_MaxChars, 10,
LG_CreateGadget ,0,
/* Height */
//LG_LeftEdge ,GadgetArea[PROM_AREA].Width/2+8,
LG_LeftEdge ,LG_REL_CELL_LEFTEDGE(1),
LG_GadgetText ,GetString(MSG_G_HEIGHT),
LG_GadgetID ,GD_HEIGHT,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_MaxChars, 10,
LG_CreateGadget ,0,
/* Do Depth */
LG_LeftEdge ,0,
LG_TopEdge ,66,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_COLORS),
LG_GadgetID ,GD_DODEPTH,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled , TRUE,
LG_CreateGadget ,0,
/* Palette */
LG_TopEdge ,79,
LG_GadgetText ,GetString(MSG_G_PALETTE),
LG_GadgetID ,GD_PALETTE,
LG_CreateGadget ,0,
/* Colors */
LG_LeftEdge ,LG_REL_RIGHT(0),
LG_TopEdge ,66,
LG_Width ,LG_REL_WIDTH(-163),
LG_GadgetText ,GetString(MSG_G_COLOR_SLIDER),
LG_GadgetID ,GD_DEPTH,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_Justification,LG_JUST_RIGHT | LG_JUST_WITHLABEL,
LG_GadgetKind ,SLIDER_KIND,
LG_KeyString ,GetString(MSG_G_COLOR_SLIDER),
LG_GadgetTags ,4,
GT_Underscore ,'_',
PGA_Freedom ,LORIENT_HORIZ,
GTSL_Min ,1,
GTSL_Max ,8,
LG_CreateGadget ,0,
/* Edit Pal */
LG_TopEdge ,79,
LG_Width ,LG_REL_WIDTH(-117),
LG_GadgetText ,GetString(MSG_G_EDIT_PALETTE),
LG_GadgetID ,GD_EDITPALETTE,
LG_Flags ,PLACETEXT_IN,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
LG_Justification,0,
/* Option Gads */
LG_Bounds ,&GadgetArea[OPT_AREA],
/* AutoScroll*/
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_AUTOSCROLL),
LG_GadgetID ,GD_AUTOSCROLL,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled, TRUE,
LG_CreateGadget ,0,
/* Interleave */
LG_TopEdge ,13,
//LG_LeftEdge ,GadgetArea[OPT_AREA].Width/2,
LG_GadgetText ,GetString(MSG_G_INTERLEAVE),
LG_GadgetID ,GD_INTERLEAVE,
LG_CreateGadget ,0,
/* Behind */
LG_TopEdge ,26,
//LG_LeftEdge ,GadgetArea[OPT_AREA].Width/2,
LG_GadgetText ,GetString(MSG_G_BEHIND),
LG_GadgetID ,GD_BEHIND,
LG_CreateGadget ,0,
/* Open Blank */
LG_TopEdge ,39,
//LG_LeftEdge ,0,
LG_GadgetText ,GetString(MSG_G_BLANK_BORDER),
LG_GadgetID ,GD_BLANK_BORDER,
LG_CreateGadget ,0,
/* Force Planar */
LG_TopEdge ,52,
LG_GadgetText ,GetString(MSG_G_FORCE_PLANAR),
LG_GadgetID ,GD_FORCE_PLANAR,
LG_CreateGadget ,0,
/* Center */
LG_LeftEdge ,0,
LG_TopEdge ,65,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,GetString(MSG_G_CENTER),
LG_GadgetID ,GD_CENTER,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&CenterLabels[0],
LG_CreateGadget ,0,
/*
/* Options List*/
LG_TopEdge ,0,
LG_Height ,LG_REL_HEIGHT(-13),
LG_GadgetText ,"_Options (T-oggle)",
LG_GadgetID ,GD_AUTOSCROLL,
LG_Flags ,PLACETEXT_ABOVE,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,3,
GTLV_ShowSelected ,0,
GT_Underscore ,'_',
GTLV_Labels ,&OptionList,
LG_CreateGadget ,0,
*/
/* End Opt */
/* Begin 3d */
LG_Bounds ,&GadgetArea[TD_AREA],
/* LOOK3D */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_3D_LOOK),
LG_GadgetID ,GD_LOOK3D,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
LG_TopEdge ,13,
LG_GadgetText ,GetString(MSG_G_3D_DEFAULT),
LG_GadgetID ,GD_3D_DEFAULT,
LG_CreateGadget ,0,
/* Reset Pens */
LG_TopEdge ,26,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,GetString(MSG_G_3D_RESET),
LG_GadgetID ,GD_RESETPENS,
LG_Flags ,PLACETEXT_IN,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* PenList */
LG_TopEdge ,39,
LG_Height ,LG_REL_HEIGHT(-52),
LG_GadgetText ,0,
LG_GadgetID ,GD_PENLIST,
LG_GadgetKind ,LISTVIEW_KIND,
LG_GadgetTags ,3,
GT_Underscore ,'_',
GTLV_CallBack ,&PenLVHook,
GTLV_ScrollWidth ,18,
LG_CreateGadget ,0,
/* PenVal */
LG_LeftEdge ,LG_REL_RIGHT(-55),
LG_TopEdge ,LG_REL_BOTTOM(-13),
LG_Width ,55,
LG_Height ,12,
LG_GadgetID ,GD_PENVAL,
LG_GadgetKind ,INTEGER_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTIN_EditHook ,&StrCursorHook,
LG_CreateGadget ,0,
/* Font */
LG_Bounds ,&GadgetArea[FONT_AREA],
/* Font Mode */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,LG_REL_WIDTH(0),
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_FONT),
LG_GadgetID ,GD_SFONT,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,CYCLE_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCY_Labels ,&SFontLabels[0],
LG_CreateGadget ,0,
/* Pick font */
LG_TopEdge ,13,
LG_GadgetText ,GetString(MSG_G_FONT_SELECT),
LG_GadgetID ,GD_PICKFONT,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* Fix Aspect */
LG_TopEdge ,39,
LG_Width ,26,
LG_GadgetText ,GetString(MSG_G_FONT_FIX_ASPECT),
LG_GadgetID ,GD_FASPECT,
LG_Flags ,PLACETEXT_RIGHT,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* End font */
/* Begin Share pens */
LG_Bounds ,&GadgetArea[SHPN_AREA],
/* Share Pens */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SHARE_PENS),
LG_GadgetID ,GD_SHAREPENS,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Exclude */
LG_TopEdge ,14,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,GetString(MSG_G_SP_EXCLUDE),
LG_GadgetID ,GD_LOCKEDPENS,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,3,
GT_Underscore ,'_',
GTST_EditHook ,&StrHook,
GTST_MaxChars ,256,
LG_CreateGadget ,0,
/* End share */
/* Begin Public */
LG_Bounds ,&GadgetArea[PUB_AREA],
/* Make Public */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_MAKE_PUBLIC),
LG_GadgetID ,GD_PUBOPT,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* Pub Name */
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,GetString(MSG_G_PUB_NAME),
LG_GadgetID ,GD_PUBNAME,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
GTST_MaxChars ,MAXPUBSCREENNAME+1,
LG_CreateGadget ,0,
/* End Pub */
/* Begin HotKey */
LG_Bounds ,&GadgetArea[HOTK_AREA],
/* Do HotKey */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,26,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_DO_HOTKEY),
LG_GadgetID ,GD_HOTKEYOPT,
LG_Flags ,PLACETEXT_RIGHT,
LG_LabelFlags ,0,
LG_GadgetKind ,CHECKBOX_KIND,
LG_GadgetTags ,2,
GT_Underscore ,'_',
GTCB_Scaled ,TRUE,
LG_CreateGadget ,0,
/* HotKey Str */
LG_TopEdge ,13,
LG_Width ,LG_REL_WIDTH(0),
LG_GadgetText ,GetString(MSG_G_HOTKEY),
LG_GadgetID ,GD_HOTKEYSTR,
LG_Flags ,PLACETEXT_LEFT,
LG_LabelFlags ,LGLF_FITLABEL,
LG_GadgetKind ,STRING_KIND,
LG_GadgetTags ,1,
GT_Underscore ,'_',
LG_CreateGadget ,0,
/* End HK */
/* Begin SUC */
LG_Bounds ,&GadgetArea[PGAD_AREA],
LG_SkipGadgets ,(ForcedEditMsg?3:0),
/* Save */
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,87,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_SAVE),
LG_GadgetID ,GD_SAVE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_CreateGadget ,0,
/* Use */
LG_LeftEdge ,GadgetArea[PGAD_AREA].Width/2,
LG_GadgetText ,GetString(MSG_G_USE),
LG_GadgetID ,GD_USE,
LG_Justification,LG_JUST_HCENTER,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,LG_REL_RIGHT(-87),
LG_GadgetText ,GetString(MSG_G_CANCEL),
LG_GadgetID ,GD_CANCEL,
LG_Justification,LG_JUST_LEFT,
LG_CreateGadget ,0,
LG_SkipGadgets ,(ForcedEditMsg?0:4),
/* */
LG_Justification,LG_JUST_LEFT,
LG_LeftEdge ,0,
LG_TopEdge ,0,
LG_Width ,128,
LG_Height ,12,
LG_GadgetText ,GetString(MSG_G_UK_USE),
LG_GadgetID ,GD_FE_SAVEUSE,
LG_Flags ,PLACETEXT_IN,
LG_LabelFlags ,0,
LG_GadgetKind ,BUTTON_KIND,
LG_CreateGadget ,0,
/* Use */
LG_LeftEdge ,feditspace * 1,
LG_GadgetText ,GetString(MSG_G_UK_USE_DELETE),
LG_GadgetID ,GD_FE_USEDELETE,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,feditspace * 2,
LG_GadgetText ,GetString(MSG_G_UK_NEVER_AGAIN),
LG_GadgetID ,GD_FE_NEVER,
LG_CreateGadget ,0,
/* Cancel */
LG_LeftEdge ,feditspace * 3,
LG_GadgetText ,GetString(MSG_G_UK_CANCEL),
LG_GadgetID ,GD_FE_CANCEL,
LG_CreateGadget ,0,
TAG_DONE);
// printf("GadControl=%8x\n",GadControl);
ColorDisp.LeftEdge =GadgetArea[PROM_AREA].Left+106;
ColorDisp.TopEdge =GadgetArea[PROM_AREA].Top+66;
ColorDisp.Width =49;
ColorDisp.Height =12;
PenNameDisp.LeftEdge =GadgetArea[TD_AREA].Left;
PenNameDisp.TopEdge =GadgetArea[TD_AREA].Top+GadgetArea[TD_AREA].Height-13;
PenNameDisp.Width =GadgetArea[TD_AREA].Width-61;
PenNameDisp.Height =12;
FontDisp.LeftEdge =GadgetArea[FONT_AREA].Left;
FontDisp.TopEdge =GadgetArea[FONT_AREA].Top+26;
FontDisp.Width =GadgetArea[FONT_AREA].Width;
FontDisp.Height =12;
SetupTextArea(&ColorDisp);
SetupTextArea(&PenNameDisp);
SetupTextArea(&FontDisp);
return(GadControl);
}
void FreeMPPGadgets(void)
{
LG_FreeGadgets(GadControl);
GadControl=0;
}
void SetupTextArea(struct TextArea *TA)
{
TA->LeftEdge = TA->LeftEdge * XScale+Win->BorderLeft;
TA->Width *= XScale;
TA->TopEdge = TA->TopEdge * YScale+Win->BorderTop;
TA->Height *= YScale;
TA->RightEdge = TA->Width + TA->LeftEdge;
TA->BottomEdge = TA->Height + TA->TopEdge;
TA->Baseline=(TA->BottomEdge - TA->TopEdge - GUIFont->tf_YSize)/2
+ GUIFont->tf_Baseline + TA->TopEdge;
}
BOOL GadgetInit(void)
{
/*
struct Node *n;
STRPTR optname;
ULONG l;
struct OItem
{
ULONG NameID;
BYTE FlagBit;
} oi[]=
{
{ MSG_G_AUTOSCROLL, 2},
{ MSG_G_BLANK_BORDER, 3},
{ MSG_G_BEHIND, 4},
{ MSG_G_FORCE_PLANAR, 5},
{ MSG_G_INTERLEAVE, 6},
{ -1,-1}
};
NewList(&OptionList);
for(l=0;oi[l].NameID!=-1;l++)
{
if(n=AllocVec(sizeof(struct Node),MEMF_PUBLIC))
{
optname=GetString(oi[l].NameID);
if(n->ln_Name=AllocVec(strlen(optname)+2,MEMF_PUBLIC))
{
n->ln_Name[0]=' ';
n->ln_Pri=oi[l].FlagBit;
strcpy(&n->ln_Name[1],optname);
EnqueueName(&OptionList,n);
}
else
{
FreeVec(n);
}
}
}
*/
return(1);
}
void GadgetCleanup(void)
{
/*
struct Node *n;
while(n=RemHead(&OptionList))
{
FreeVec(n->ln_Name);
FreeVec(n);
}
*/
}
*/